# 将从有道翻译的句子对转换成wiki形式 \t分隔

path = r'/data/corpus_hj/back_translation_5000.txt'
f = r'/data/corpus_hj/synonymous_validation.txt'


def read_write_file(path, f):
    f2 = open(f, 'a+')
    i = 0
    with open(path, 'r') as f1:
        lines = f1.readlines()
        for line in lines:
            i += 1
            if i < 1001:
                line_list = line.strip().split("\t")
                f2.write(line_list[0] + "\t" + line_list[2] + "\n")
    f2.close()


if __name__ == '__main__':
    read_write_file(path, f)
